package com.chance.cc.crawler.development.command.trigger.domain.bitauto;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-18 13:28:49
 * @email okprog@sina.com
 */
public class BitAutoWebSchedulerTrigger {
    private static final String domain = "bitauto";

    private static final CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand("192.168.1.215",9599);



    /**
     * 发布易车新闻trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoArticleCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "易车新闻实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布易车新闻回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoArticleTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车新闻回溯三天采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }


    /**
     * 发布易车视频trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoVideoCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "易车视频实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布易车视频回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoVideoTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车视频回溯三天采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }


    /**
     * 发布易车论坛最新发布trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoForumReleaseCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "易车论坛最新发布实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布易车论坛最新回复trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoForumReplyCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车论坛最新回复回溯采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布易车论坛回溯三天互动量trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoForumInteractionCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车论坛回溯三天互动量采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }


    /**
     * 发布易车口碑实时采集任务trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoPraiseCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "易车口碑实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布易车口碑回溯七天回复trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoPraiseTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车口碑回溯七天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }



    /**
     * 发布易车号文章实时采集任务trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoHaoArticleCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "易车号文章实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布易车号文章回溯七天回复trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoHaoArticleTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "易车号文章回溯七天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }


    /**
     * 发布易车测试发布trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishBitAutoTestCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "易车测试"
        );

        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
}
